 
#include<iostream>
#include<cstdio>
using namespace std;
#define MAX 300300

int n;
int P[MAX], Q[MAX], id[MAX];

int main() {
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i)
        scanf("%d", &P[i]);
    for (int i = 1; i <= n; ++i)
        scanf("%d", &Q[i]);
    for (int i = 1; i <= n; ++i)
        id[Q[i]] = i;
    for (int i = 1; i <= n; ++i)
        printf("%d ", Q[P[id[i]]]);
    puts("");
    return 0;
}
 
